package com.yyfax.pay.common.model.vo;

import com.yyfax.pay.common.exception.PayExceptionCode;

/**
 * 支付响应码实体
 * 
 * @author buyi
 * @date 2017-09-27 11:15:58
 * @since v2.0.0
 */
public class PayRspCodeVO {
	private int code;
	private String desc;

	private Object obj;

	private boolean isTimeout = false;

	public static PayRspCodeVO newInstance() {
		return new PayRspCodeVO();
	}

	/**
	 * 初始化实例
	 * 
	 * @author buyi
	 * @date 2017-09-28 19:40:56
	 * @since v2.0.0
	 * @param expCode
	 * @return
	 */
	public static PayRspCodeVO newInstance(PayExceptionCode expCode) {
		return newInstance(expCode.getCode(), expCode.getDesc());
	}

	/**
	 * 初始化实例
	 * 
	 * @author buyi
	 * @date 2017-09-27 11:24:52
	 * @since v2.0.0
	 * @param code 响应码
	 * @return
	 */
	public static PayRspCodeVO newInstance(int code) {
		return new PayRspCodeVO().setCode(code);
	}

	/**
	 * 初始化实例
	 * 
	 * @author buyi
	 * @date 2017-09-27 11:17:16
	 * @since v2.0.0
	 * @param code 响应码
	 * @param desc 描述
	 * @return
	 */
	public static PayRspCodeVO newInstance(int code, String desc) {
		return new PayRspCodeVO(code, desc);
	}

	private PayRspCodeVO() {
		super();
	}

	private PayRspCodeVO(int code, String desc) {
		super();
		this.code = code;
		this.desc = desc;
	}

	public int getCode() {
		return code;
	}

	public PayRspCodeVO setCode(int code) {
		this.code = code;
		return this;
	}

	public String getDesc() {
		return desc;
	}

	public PayRspCodeVO setDesc(String desc) {
		this.desc = desc;
		return this;
	}

	public Object getObj() {
		return obj;
	}

	public PayRspCodeVO obj(Object obj) {
		this.obj = obj;
		return this;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	public boolean isTimeout() {
		return isTimeout;
	}

	public void setTimeout(boolean isTimeout) {
		this.isTimeout = isTimeout;
	}
}
